package math.vectorSpace;

/**
 * The Abstract InnerProductSpace Class.
 * All inner product space subclasses must define their own operations.
 * Subclasses must also implement at least one constructor,
 * which creates the zero vector in the vector space.
 *
 * Last Updated: Nov 10, 2011
 * 
 * @param <V> 
 * @author Shimu Wu
 * @version 1.0
 */
public interface InnerProductSpace<V> extends VectorSpace<V> {

    /**
     * Returns the dot product of this vector and the given vector.
     *
     * @param v2 the vector to be dotted with this vector
     * @return the dot product of this vector and the given vector
     */
    public double dot(V v2);

    /**
     * Returns the length (magnitude) of this vector.
     *
     * @return the length of this vector
     */
    public double length();

    /**
     * Returns the angle in degrees between this vector and a given vector.
     * The angle returned will be between [0, 180] degrees
     *
     * @param v2 the other vector
     * @return the angle between this vector and the given vector in degrees.
     */
    public double angleD(V v2);

    /**
     * Returns the angle in radians between this vector and a given vector.
     * The angle returned will be between [0, pi] radians
     *
     * @param v2 the other vector
     * @return the angle between the this vector and the given vector
     * in radians.
     */
    public double angleR(V v2);

    /**
     * Returns a new Vector3D that is the projection of this vector
     * onto the given vector.
     *
     * @param v2 the other vector
     * @return a new vector that represents the projection of this
     * vector onto the given vector
     */
    public V projectOnto(V v2);

    /**
     * Returns true if the given vector is orthogonal (perpendicular) to 
     * this vector. False otherwise.
     * 
     * @param v2 the vector to be compared to this vector
     * @return true if the given vector is orthogonal to this vector, false
     * otherwise
     */
    public boolean isOrthogonal(V v2);

    /**
     * Returns true if this vector and the given vector are colinear,
     * i.e. the vectors are scalar multiples of each other.
     *
     * @param v2 the other vector
     * @return true if this vector and the given vector are colinear,
     * false otherwise
     */
    public boolean isColinear(V v2);
    
    /**
     * Returns the String representation of this vector
     *
     * @return the String representation of this vector
     */
    @Override
    public String toString();
}
